<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <ul id="list">
        <!-- <li>
            <strong>1</strong>
            <a href="">新闻的内容</a>
            <span>2022-8-18</span>
        </li> -->
    </ul>


    <script>

        var data = [
            ['新闻1'  , '2022-8-18'] ,
            ['新闻2'  , '2022-8-18'] ,
            ['新闻3'  , '2022-8-18'] ,
            ['新闻4'  , '2022-8-18'] ,
        ]

        // 数据有四大条   动态生成4个li

        var res = '' ;
        // res += '<li>1</li>'
        // res += '<li>1</li>'
        // res += '<li>1</li>'
        // res += '<li>1</li>'

        // for(var i in data) {
        //     res += '<li>' + data[i][0] + '</li>'
        // }


        for(var i in data) {
            res += '<li>' ;
            res += '<strong>' + (i * 1 + 1) + '</strong>'
            res += '<a href="">' + data[i][0] + '</a>'
            res += '<span>' + data[i][1] + '</span>'
            res += '</li>'
        }

        var oUl = document.getElementById('list') ;
        console.log(oUl);
        oUl.innerHTML = res ;



    </script>
    
</body>
</html>